import {createRouter, createWebHashHistory} from "vue-router";
import initBeforeRouter from "@/router/before.js";

const routes = [
    {
        path: '/',
        name: "layout",
        component: () => import("@/page/layout/Index.vue"),
        redirect: '/index',
        children: [
            {
                path: '/index',
                name: "index",
                component: () => import("@/page/index/Index.vue")
            },
            {
                path: '/auth/user',
                name: "/auth/user",
                component: () => import("@/page/auth/AuthUser.vue")
            },
        ]
    },
    {
        path: "/login",
        name: "/login",
        component: () => import("@/page/common/Login.vue"),
    },
    {
        path: "/bigscreen",
        name: "/bigscreen",
        component: () => import("@/app_bigscreen/Index.vue"),
    }
]
const router = createRouter({
    history: createWebHashHistory(),
    routes,
})

initBeforeRouter(router) // 初始化前置路由守卫

export default router